package cn.wolfcode.wolf2w.business.test.service.impl;

import cn.wolfcode.wolf2w.business.service.LogisticsStrategy;
import cn.wolfcode.wolf2w.business.test.TradeOrder;

public class BuyerMessageStrategy implements LogisticsStrategy {
    private String keyWord;
    private Long logisticsId;

    public BuyerMessageStrategy(String keyWord, Long logisticsId) {
        this.keyWord = keyWord;
        this.logisticsId = logisticsId;
    }

    @Override
    public boolean match(TradeOrder order) {
        return order.getBuyerMessage().contains(keyWord);
    }

    @Override
    public Long getLogisticsId() {
        return logisticsId;
    }
}